--- /dev/null
+<?php
+function shutdown_mysql_close() {
+ // NOTE: fix things like this :
+ // Warning: mysql_select_db(): 2 is not a valid MySQL-Link resource in test.php
+ // which is likely due to php5-fpm not correctly destroying all PHP variables ;
+ // uses auto_prepend_file in php.ini :
+ // - works when script ends or exit() is called;
+ // - works when mysql.so is loaded or not;
+ // - not sure if this works with multiple MySQL connexions.
+ if(function_exists('mysql_close'))
+ @mysql_close();
+ }
+register_shutdown_function('shutdown_mysql_close');
+?>
[mbstring]
[mcrypt]
[MSSQL]
-mssql.allow_persistent = On
+mssql.allow_persistent = Off
mssql.compatability_mode = Off
mssql.max_links = -1
mssql.max_persistent = -1
mssql.secure_connection = Off
[MySQL]
mysql.allow_local_infile = On
-mysql.allow_persistent = On
+mysql.allow_persistent = Off
mysql.cache_size = 2000
mysql.connect_timeout = 60
mysql.default_host =
mysql.default_socket = /run/mysqld/sock/mysql
mysql.default_user =
mysql.max_links = -1
-mysql.max_persistent = -1
+mysql.max_persistent = 0
mysql.trace_mode = On
[MySQLi]
-mysqli.allow_persistent = On
+mysqli.allow_persistent = Off
mysqli.cache_size = 2000
mysqli.default_host =
mysqli.default_port = 3306
asp_tags = Off
auto_append_file =
auto_globals_jit = On
-auto_prepend_file =
+auto_prepend_file = /etc/php5/fpm/auto_prepend_file.php
default_charset = "UTF-8"
; DEFAULT:
default_mimetype = "text/html"
#php_admin_value[extension] = pdo_mysql.so
php_admin_value[extension] = mysql.so
pm.max_children = 15
-pm.max_requests = 200
+pm.max_requests = 1000
pm.max_spare_servers = 5
pm.min_spare_servers = 1
pm.process_idle_timeout = 60s
#php_admin_value[extension] = pdo_mysql.so
php_admin_value[extension] = mysql.so
pm.max_children = 4
-pm.max_requests = 1
+pm.max_requests = 1000
pm.max_spare_servers = 4
pm.min_spare_servers = 2
pm.process_idle_timeout = 60s
#php_admin_value[extension] = pdo_mysql.so
php_admin_value[extension] = mysql.so
pm.max_children = 4
-pm.max_requests = 1
+pm.max_requests = 1000
pm.max_spare_servers = 4
pm.min_spare_servers = 2
pm.process_idle_timeout = 60s
sudo install -m 664 -o php5 -g php5 \
"$tool"/etc/php5/fpm/php.ini \
/etc/php5/fpm/php.ini
+sudo install -m 664 -o php5 -g php5 \
+ "$tool"/etc/php5/fpm/auto_prepend_file.php \
+ /etc/php5/fpm/auto_prepend_file.php
for conf in $(
test ! -d "$tool"/etc/php5/fpm/conf.d ||
find "$tool"/etc/php5/fpm/conf.d \